<template>
    <a-modal v-model:visible="visible" title="Basic Modal" destroyOnClose :afterClose="unmountInstance">
  <div>
    这是 单独 创建的 Vue  实例
    <a-button @click="changeTime">修改时间</a-button>
    <a-button @click="changeRoute">切换路由</a-button>
  </div>
    </a-modal>

</template>

<script>
import { ref } from 'vue'
import { useStore } from "vuex";
import router from '@/router'
import { computed } from '@vue/reactivity';
import { useRouter } from "vue-router";
export default {
  props: {
    unmountInstance: {
      type: Function,
      default: () => {}
    },
    time: {
      type: [String, Number],
      default: ''
    },
    fn:{
      type: Function,
      default: () => {}
    }
  },
  setup() {

    const visible = ref(true)

    // const store = useStore()

    // const time = computed(() => store.state.time)

    // const router = useRouter()

    // const { state } = store
    // function changeTime(){
    //   store.commit('changeTime')
    // }

    // function changeRoute(){
    //   router.push('/compileDemand/initialScheme')
    // }

    // return {time, changeTime, changeRoute}
    return {visible}

  },
}
</script>



